<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class Login extends Controller{
    function Login(){
        parent::Controller();
    }

    function index(){
        //$this->load->model();
        $this->load->view("loginview");
        //echo 'AA';
    }

    function cekLogin(){
        $this->load->helper('url');
        $this->load->model('login_model','log',TRUE);
        $userdata = $this->log->cekLogin();
        if (isset($userdata)){
            redirect(base_url(). index_page().'/home/', 'location');
        }
        else{
            
        }
    }

    function logout(){
        $this->load->helper('url');
        $this->session->sess_destroy();
        redirect(base_url(),'location');
    }
}
?>
